package com.puff.mapper;

import com.github.pagehelper.Page;
import com.puff.annotation.AutoFill;
import com.puff.dto.CustomerPageQueryDTO;
import com.puff.entity.Customer;
import com.puff.enumeration.OperationType;
import com.puff.vo.CustomerVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CustomerMapper {

    /**
     * 客服列表分页查询
     * @param customerPageQueryDTO
     * @return
     */
    Page<CustomerVO> pageQuery(CustomerPageQueryDTO customerPageQueryDTO);

    /**
     * 修改客服数据
     * @param customer
     */
    @AutoFill(OperationType.UPDATE)
    void update(Customer customer);

    /**
     * 新增客服
     * @param customer
     */
    @AutoFill(OperationType.INSERT)
    void insert(Customer customer);


    /**
     * 批量删除客服信息
     * @param ids
     */
    void deleteByIds(List<Long> ids);

    /**
     * 根据id查询客服信息
     * @param id
     * @return
     */
    @Select("select * from customer where id = #{id}")
    Customer getById(Long id);
}
